# Table I1

#####
rm(list=ls(all=TRUE))

library(MASS)
library(stargazer)

#### Dataset Original ####
setwd("/Users/sebastian/Dropbox/The politics of interruptions - JOP RR/Replication Files/Data Rep")
load("data_empirics_rep.Rdata")

# After one minute interruptions interaction and high reputation

data_one <- data_empirics[data_empirics$one_minute_dummy==1,]

model_after_one_int_1 <- glm.nb(length_after_one ~ female_dum + ideology_ext + 
                                  committee_chair + seniority + type_member +
                                  party_match_pres + 
                                  election_year + length_speech_nocont_100 +
                                  tot_num_speeches_session_10 + mean_length_leg +
                                  negative_lang_w + mujeres_dummy +
                                  committee_chair*female_dum +
                                  factor(cohort), 
                                data = data_one)

summary(model_after_one_int_1)

model_after_one_int_2 <- glm.nb(length_after_one ~ female_dum + ideology_ext + 
                                  committee_chair + seniority + type_member +
                                  party_match_pres + 
                                  election_year + length_speech_nocont_100 +
                                  tot_num_speeches_session_10 + mean_length_leg +
                                  negative_lang_w + mujeres_dummy +
                                  seniority*female_dum +
                                  factor(cohort), 
                                data = data_one)

summary(model_after_one_int_2)

# Length after aggressive interruptions and high reputation

data_empirics_aggressive <- data_empirics[data_empirics$aggressive_interruption_dummy==1,]  

model_after_agg_int_1 <- glm.nb(length_after_aggressive ~ female_dum + ideology_ext + 
                                  committee_chair + seniority + type_member +
                                  party_match_pres + 
                                  election_year + length_speech_nocont_100 +
                                  tot_num_speeches_session_10 + mean_length_leg +
                                  negative_lang_w + mujeres_dummy +
                                  committee_chair*female_dum +
                                  factor(cohort), 
                                data = data_empirics_aggressive)

summary(model_after_agg_int_1)

model_after_agg_int_2 <- glm.nb(length_after_aggressive ~ female_dum + ideology_ext + 
                                  committee_chair + seniority + type_member +
                                  party_match_pres + 
                                  election_year + length_speech_nocont_100 +
                                  tot_num_speeches_session_10 + mean_length_leg +
                                  negative_lang_w + mujeres_dummy +
                                  seniority*female_dum +
                                  factor(cohort), 
                                data = data_empirics_aggressive)

summary(model_after_agg_int_2)

### TABLE I1: Strategic behavior and high reputation
setwd("/Users/sebastian/Dropbox/The politics of interruptions - JOP RR/Replication Files/Table")

stargazer(model_after_one_int_1, model_after_one_int_2, model_after_agg_int_1,model_after_agg_int_2,
          type = "html", style = "ajps", out = "tableI1.html",
          covariate.labels = c("Woman","Ideological Extremism","Committee Chair",
                               "Seniority","National MC","Same Party as Leg. Pres.",
                               "Election Year", "Length of Speech","Speeches during Session",
                               "Mean Length of MC Speech",
                               "Negative Language (Speech)", "Topic: Women",
                               "Woman x Committee Chair",
                               "Woman x Seniority"),
          omit = "factor",
          no.space=TRUE,
          dep.var.labels=c("Length After One-Minute Warning", "Length After Aggressive Inter."),
          digits=3,
          df = FALSE,
          keep.stat = c("theta", "n"))
